package com.wao.cms.service.dto;


import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.LinkedHashSet;
import java.util.Objects;
import java.util.Set;

/**
 * A DTO for the Website entity.
 */
public class WebsiteDTO implements Serializable {

    private Long id;

    private String name;

    private String image;

    private String domain;

    private String copyright;

    private String favicon;

    private ZonedDateTime expirationTime;

    @Size(max = 8)
    private String defaultLangKey;

    private Set<String> langKeys = new LinkedHashSet<String>(0);

    private String keywords;

    private String description;

    @NotNull
    private Boolean enabled;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getCopyright() {
        return copyright;
    }

    public void setCopyright(String copyright) {
        this.copyright = copyright;
    }

    public String getFavicon() {
        return favicon;
    }

    public void setFavicon(String favicon) {
        this.favicon = favicon;
    }

    public ZonedDateTime getExpirationTime() {
        return expirationTime;
    }

    public void setExpirationTime(ZonedDateTime expirationTime) {
        this.expirationTime = expirationTime;
    }

    public String getDefaultLangKey() {
        return defaultLangKey;
    }

    public void setDefaultLangKey(String defaultLangKey) {
        this.defaultLangKey = defaultLangKey;
    }

    public Set<String> getLangKeys() {
        return langKeys;
    }

    public void setLangKeys(Set<String> langKeys) {
        this.langKeys = langKeys;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        WebsiteDTO websiteDTO = (WebsiteDTO) o;
        if (websiteDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), websiteDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "WebsiteDTO{" +
            "id=" + getId() +
            ", name='" + getName() + "'" +
            ", image='" + getImage() + "'" +
            ", domain='" + getDomain() + "'" +
            ", copyright='" + getCopyright() + "'" +
            ", favicon='" + getFavicon() + "'" +
            ", expirationTime='" + getExpirationTime() + "'" +
            ", defaultLangKey='" + getDefaultLangKey() + "'" +
            ", langKeys='" + getLangKeys() + "'" +
            ", keywords='" + getKeywords() + "'" +
            ", description='" + getDescription() + "'" +
            ", enabled='" + isEnabled() + "'" +
            "}";
    }
}
